<template>
	<view>

		<u-toast ref="uToast"></u-toast><!-- 弹窗 -->
		<view class="flow-sticky">

			<u-tabs name="name" :list="tabs" :is-scroll="false" :current="current" @change="tabsChange" bar-width="60"
				bar-height="6"></u-tabs>

		</view>

		<block>
			<view class="nodeList-v" v-show="tabsName === '未扫描'">
				<scan :No='No' :BoxNo='BoxNo' />
			</view>

			<view v-show="tabsName === '已扫描'">
				<detail :No='No' :BoxNo='BoxNo'></detail>
			</view>

		</block>

	</view>
</template>

<script>
	import detail from '@/pages/q1/business/scan/detail.vue'
	import scan from '@/pages/q1/business/scan/unscan.vue'
	export default {
		components: {
			detail,
			scan,

		},
		data() {
			return {
				title: '', // 标题
				tabs: [{
					name: '未扫描'
				}, {
					name: '已扫描'
				}],
				tabsTemporary: [],
				current: 0, // 默认激活的标签
				tabsName: '未扫描', // 默认激活标签名称
				No: '',
				BoxNo: ''
			}
		},
		onLoad(e) {

			uni.setNavigationBarTitle({
				title: "箱号:" + e.BoxNo
			})

			this.No = e.No;
			this.BoxNo = e.BoxNo
			//未扫描
			//uni.$emit('refreshData')
		},

		methods: {


			init() {

			},

			tabsChange(index) {
				console.log(index)
				this.current = index;
				this.tabsName = this.tabs[index].name;

				if (index === 0) {
					//未扫描
					uni.$emit('refreshData')
				} else {
					//已扫描
					uni.$emit('refreshScan')
				}
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f0f2f6;
	}

	// 不随滚动条滚动
	.flow-sticky {
		position: sticky;
		//top: var(--window-top);
		z-index: 200;
	}

	.flow-urgent-value {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 60rpx;
		font-size: 28rpx;
	}
</style>